package com.yzw.common.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yzw.common.domain.EduAclUser;
import com.yzw.common.mapper.EduAclUserMapper;
import com.yzw.common.service.EduAclUserService;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
*
*/
@Service
public class EduAclUserServiceImpl extends ServiceImpl<EduAclUserMapper, EduAclUser>
implements EduAclUserService, UserDetailsService {
    @Resource
    EduAclUserMapper eduAclUserMapper;

    @Override
    public EduAclUser loadUserByUsername(String username) throws UsernameNotFoundException {
        EduAclUser eduAclUser = eduAclUserMapper.getUserName(username);
        if (eduAclUser == null){
            throw new UsernameNotFoundException("用户不存在");
        }
        return eduAclUser;
    }
}
